home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / misc / math / permutation.readme < prev    next >
Encoding:
Text File  |  1999-09-06  |  1.5 KB  |  50 lines

  1. Short:        Generate permutations, source code in C
  2. Author:       ralf.gruner@t-online.de (Ralf Gruner)
  3. Uploader:     ralf.gruner@t-online.de (Ralf Gruner)
  4. Type:         misc/math
  5. Distribution: Public Domain
  6.  
  7.  
  8.  This program generates all permutations of the elements of an array.
  9.  The example works with an array of characters, but can be changed for
  10.  any other element types.
  11.  
  12.  Use the executable in a shell window with this syntax:
  13.  
  14.  permutation <text>
  15.  
  16.  
  17.  Example:
  18.  
  19.  1.Ram Disk:>permutation abc
  20.  abc
  21.  acb
  22.  bac
  23.  bca
  24.  cab
  25.  cba
  26.  
  27.  
  28.  The code is a port of a Pascal program I have written in 1988.
  29.  The permutations are generated in a recursive function using a mask
  30.  for filtering the remainig elements.
  31.  The sort algorithm is simple and can be replaced by the library
  32.  function qsort or can be removed.
  33.  
  34.  Ralf Gruner, Großschönau, Germany                    27 August 1999
  35.  
  36.  
  37. ============================= Archive contents =============================
  38.  
  39. Original  Packed Ratio    Date     Time    Name
  40. -------- ------- ----- --------- --------  -------------
  41.     6024    4066 32.5% 26-Aug-99 19:41:46 +permutation
  42.     1021     475 53.4% 27-Aug-99 16:14:08 +permutation.c
  43.      488     280 42.6% 27-Aug-99 17:39:06 +permutation.c.info
  44.      835     394 52.8% 27-Aug-99 17:39:06 +permutation.info
  45.      872     459 47.3% 27-Aug-99 17:19:26 +permutation.readme
  46.     3304     349 89.4% 27-Aug-99 17:39:06 +permutation.readme.info
  47.      628     275 56.2% 27-Aug-99 17:42:02  Permutation.info
  48. -------- ------- ----- --------- --------
  49.    13172    6298 52.1% 28-Aug-99 06:19:26   7 files
  50.